import random
#A = [random.randint(1,50) for i in range(random.randint(10,20))]
#print(A)  #生成随机10~20个数字的列表
def find_mid(*args):
    B = sorted(*args)
    print(B)  #查看排序后的列表，仅作为肉眼验证，可不打印
    l = len(B)
    if l % 2 == 0:
        index = int((l-1)/2)
        mid = (B[index]+B[index+1])/2
    else:
        index = int(l/2)
        mid = B[index]
    return mid
print(find_mid([5,3,6,8,9,2,6,3,7,9,2,4]))
